package com.zhuozhou.jdyc.main.main.adapter;

import android.content.Context;

import com.zhuozhou.jdyc.R;
import com.zhuozhou.jdyc.base.BaseRecyclerViewAdapter;
import com.zhuozhou.jdyc.base.BaseViewHolder;
import com.zhuozhou.jdyc.databinding.MenuItemBinding;
import com.zhuozhou.jdyc.main.main.bean.MenuItemBean;
import com.zhuozhou.jdyc.util.log.LogUtil;

/**
 * Create by CherishTang on 2020/3/27 0027
 * describe:首页菜单adapter
 */
public class IndexMenuAdapter extends BaseRecyclerViewAdapter<MenuItemBean, MenuItemBinding> {
    int width = 0;

    public IndexMenuAdapter(Context context) {
        super(context);
    }

    int color = R.color.black;

    public void setTextColor(int color) {
        this.color = color;
    }
    public void setViewWidth(int width) {
        this.width = width;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.menu_item;
    }

    @Override
    public void onBindHolder(BaseViewHolder<MenuItemBinding> holder, int pos) {
        LogUtil.d(mList.size() + "");
        holder.getBinding().customTextView.init(mList.get(pos).getImageUrl(), mList.get(pos).getImageName(), mList.get(pos).getTag());
        holder.getBinding().customTextView.setWidth(width);
        holder.getBinding().customTextView.setColor(color);
    }
}
